<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<body>
    <div th:fragment="pagination(pageInfo, link)">
        <nav style="text-align: center;">
            <ul class="pagination">
                <th:block th:if="${pageInfo.hasPreviousPage} and ${pageInfo.pages gt 5}">
                    <li class="page-item"><a class="page-link" th:href="${link}+'?page='+${pageInfo.prePage}"><<</a></li>
                </th:block>
                <th:block th:each="nav : ${pageInfo.navigatepageNums}">
                    <li th:class="${nav==pageInfo.pageNum}?'page-item active':'page-item'">
                        <a th:text="${nav}" class="page-link" th:href="${link}+'?page='+${nav}"></a>
                    </li>
                </th:block>
                <th:block th:if="${pageInfo.hasNextPage} and ${pageInfo.pages gt 5}">
                    <li class="page-item"><a class="page-link" th:href="${link}+'?page='+${pageInfo.nextPage}">>></a></li>
                </th:block>
            </ul>
        </nav>
    </div>

</body>
</html>